var touch = {
    tap: function (dom,callback) {

        var startX, startY;
        var currentX, currentY;
        var touchTime;
        dom.addEventListener('touchstart', function (event) {
            if (event.targetTouches.length > 1) {
                return;
            }
            touchTime = Date.now();
            // console.log(touchTime)
            startX = event.targetTouches[0].clientX;
            startY = event.targetTouches[0].clientY;
        });
        dom.addEventListener('touchend', function () {
            currentX = event.changedTouches[0].clientX;
            currentY = event.changedTouches[0].clientY;
            // console.log(currentX-startX,currentY-startY);

            var currentTime = Date.now() - touchTime;
            // console.log(currentTime);
            if (currentTime >= 200) {
                return;
            }
            if (Math.abs(currentX - startX) > 6 || Math.abs(currentY - startY) > 6) {
                return;
            }
            callback && callback(event);
        })
    }
}